package com.jugheadzhou.practice.juc;

import java.util.concurrent.atomic.AtomicInteger;

public class CasDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(2021);

        System.out.println(atomicInteger.compareAndSet(2021, 2022));
        System.out.println(atomicInteger);
    }
}
